@echo off
chcp 65001 >nul
echo ========================================
echo   诊断后台运行问题
echo ========================================
echo.

echo [1] 检查服务是否在运行...
echo.
adb shell dumpsys activity services com.example.munidingwei | findstr "RealLocationForegroundService"
echo.

echo [2] 检查最近的日志（最近30秒）...
echo.
adb logcat -t 30 | findstr "RealLocationService\|BackendClient"
echo.

echo [3] 检查电池优化状态...
echo.
adb shell dumpsys deviceidle whitelist | findstr "com.example.munidingwei"
echo.

echo [4] 检查位置权限...
echo.
adb shell dumpsys package com.example.munidingwei | findstr "android.permission.ACCESS"
echo.

echo ========================================
echo.
pause



